package com.intpro.demo.DAO;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.intpro.demo.Utils.MyAnnotations.AutoIncrement;
import java.io.Serializable;
import java.util.ArrayList;
import javax.validation.constraints.*;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

@Document(collection = "user")
public class User implements Serializable
{
	@Id
	@AutoIncrement(baseNum = 1000)
	public long id;

	@Size(min = 3, max = 20, message = "用户名长度应该在3-20个字符")
	@Indexed(unique = true)
	public String account;


	//@Email(message = "需要合法邮箱")
	public String email;

	@Size(min = 6, max = 20, message = "密码长度应该在6-20个字符")
	@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
	public String password;

	//@Size(min = 3, max = 20, message = "用户名长度应该在3-20个字符")
	public String nickName;

	@Indexed(unique = true)
	public String phone;

	public String picUrl;

	public ArrayList<Long> subscribe;
	public ArrayList<Long> collection;

	public long ProID;

}
